const https = require("https");
const path = require("path");
const fs = require("fs");

const app = https.createServer(
    {
        // 服务器私钥
        key: fs.readFileSync(path.resolve(__dirname, './server-key.pem')),
        // 服务器证书
        cert: fs.readFileSync(path.resolve(__dirname, './server-cert.crt')),
    },
    (req, res) => {
        // handler
    }
);

app.listen(3000, () => console.log("https服务启动成功"));